package cn.schoolwow.ams.module.block.listBlock.common.flow;

import cn.schoolwow.ams.domain.block.list.common.ListBlockOption;
import cn.schoolwow.ams.module.block.common.flow.SetBlockOperationCommonFlow;
import cn.schoolwow.ams.module.block.listBlock.common.domain.context.ListBlockContext;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;

public class SetListBlockOperationCommonFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        ListBlockOption listBlockOption = flowContext.checkInstanceData(ListBlockOption.class);
        ListBlockContext listBlockContext = flowContext.checkInstanceData(ListBlockContext.class);

        flowContext.startFlow(new SetBlockOperationCommonFlow())
                .putCurrentCompositeFlowData("blockOperationList", listBlockOption.blockOperationList)
                .putCurrentCompositeFlowData("blockOperationContextList", listBlockContext.listBlockContextOption.blockOperationContextList)
                .execute();
    }

    @Override
    public String name() {
        return "设置ListBlock类型用户操作列表";
    }
}
